<?php

/**
 * GameArmor filter form base class.
 *
 * @package    aiontoolskit
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseGameArmorFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'item_type'         => new sfWidgetFormChoice(array('choices' => array('' => '', 'abyss' => 'abyss', 'devanion' => 'devanion', 'draconic' => 'draconic', 'normal' => 'normal'))),
      'icon_name'         => new sfWidgetFormFilterInput(),
      'equipment_slots'   => new sfWidgetFormChoice(array('choices' => array('' => '', 'foot' => 'foot', 'glove' => 'glove', 'head' => 'head', 'leg' => 'leg', 'shoulder' => 'shoulder', 'sub' => 'sub', 'torso' => 'torso', 'torso glove foot shoulder leg' => 'torso glove foot shoulder leg'))),
      'quality_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameItemQuality'), 'add_empty' => true)),
      'level'             => new sfWidgetFormFilterInput(),
      'gender_permitted'  => new sfWidgetFormChoice(array('choices' => array('' => '', 'all' => 'all', 'female' => 'female', 'male' => 'male'))),
      'option_slot_bonus' => new sfWidgetFormFilterInput(),
      'bonus_apply'       => new sfWidgetFormFilterInput(),
      'no_enchant'        => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'faction_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameFaction'), 'add_empty' => true)),
      'bonus_attr1'       => new sfWidgetFormFilterInput(),
      'bonus_attr2'       => new sfWidgetFormFilterInput(),
      'bonus_attr3'       => new sfWidgetFormFilterInput(),
      'bonus_attr4'       => new sfWidgetFormFilterInput(),
      'bonus_attr5'       => new sfWidgetFormFilterInput(),
      'bonus_attr6'       => new sfWidgetFormFilterInput(),
      'bonus_attr7'       => new sfWidgetFormFilterInput(),
      'bonus_attr8'       => new sfWidgetFormFilterInput(),
      'bonus_attr9'       => new sfWidgetFormFilterInput(),
      'bonus_attr10'      => new sfWidgetFormFilterInput(),
      'bonus_attr11'      => new sfWidgetFormFilterInput(),
      'bonus_attr12'      => new sfWidgetFormFilterInput(),
      'armor_type'        => new sfWidgetFormChoice(array('choices' => array('' => '', 'chain' => 'chain', 'clothes' => 'clothes', 'leather' => 'leather', 'no_armor' => 'no_armor', 'plate' => 'plate', 'robe' => 'robe'))),
      'dodge'             => new sfWidgetFormFilterInput(),
      'magical_resist'    => new sfWidgetFormFilterInput(),
      'physical_defend'   => new sfWidgetFormFilterInput(),
      'block'             => new sfWidgetFormFilterInput(),
      'damage_reduce'     => new sfWidgetFormFilterInput(),
      'reduce_max'        => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'item_type'         => new sfValidatorChoice(array('required' => false, 'choices' => array('abyss' => 'abyss', 'devanion' => 'devanion', 'draconic' => 'draconic', 'normal' => 'normal'))),
      'icon_name'         => new sfValidatorPass(array('required' => false)),
      'equipment_slots'   => new sfValidatorChoice(array('required' => false, 'choices' => array('foot' => 'foot', 'glove' => 'glove', 'head' => 'head', 'leg' => 'leg', 'shoulder' => 'shoulder', 'sub' => 'sub', 'torso' => 'torso', 'torso glove foot shoulder leg' => 'torso glove foot shoulder leg'))),
      'quality_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameItemQuality'), 'column' => 'id')),
      'level'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'gender_permitted'  => new sfValidatorChoice(array('required' => false, 'choices' => array('all' => 'all', 'female' => 'female', 'male' => 'male'))),
      'option_slot_bonus' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonus_apply'       => new sfValidatorPass(array('required' => false)),
      'no_enchant'        => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'faction_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameFaction'), 'column' => 'id')),
      'bonus_attr1'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr2'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr3'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr4'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr5'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr6'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr7'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr8'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr9'       => new sfValidatorPass(array('required' => false)),
      'bonus_attr10'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr11'      => new sfValidatorPass(array('required' => false)),
      'bonus_attr12'      => new sfValidatorPass(array('required' => false)),
      'armor_type'        => new sfValidatorChoice(array('required' => false, 'choices' => array('chain' => 'chain', 'clothes' => 'clothes', 'leather' => 'leather', 'no_armor' => 'no_armor', 'plate' => 'plate', 'robe' => 'robe'))),
      'dodge'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'magical_resist'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'physical_defend'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'block'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'damage_reduce'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'reduce_max'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('game_armor_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'GameArmor';
  }

  public function getFields()
  {
    return array(
      'id'                => 'Number',
      'item_type'         => 'Enum',
      'icon_name'         => 'Text',
      'equipment_slots'   => 'Enum',
      'quality_id'        => 'ForeignKey',
      'level'             => 'Number',
      'gender_permitted'  => 'Enum',
      'option_slot_bonus' => 'Number',
      'bonus_apply'       => 'Text',
      'no_enchant'        => 'Boolean',
      'faction_id'        => 'ForeignKey',
      'bonus_attr1'       => 'Text',
      'bonus_attr2'       => 'Text',
      'bonus_attr3'       => 'Text',
      'bonus_attr4'       => 'Text',
      'bonus_attr5'       => 'Text',
      'bonus_attr6'       => 'Text',
      'bonus_attr7'       => 'Text',
      'bonus_attr8'       => 'Text',
      'bonus_attr9'       => 'Text',
      'bonus_attr10'      => 'Text',
      'bonus_attr11'      => 'Text',
      'bonus_attr12'      => 'Text',
      'armor_type'        => 'Enum',
      'dodge'             => 'Number',
      'magical_resist'    => 'Number',
      'physical_defend'   => 'Number',
      'block'             => 'Number',
      'damage_reduce'     => 'Number',
      'reduce_max'        => 'Number',
    );
  }
}
